<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1992-2017 Free Software Foundation, Inc.
Contributed by Cygnus Support.  Written by Julia Menapace, Jim Kingdon,
and David MacKenzie.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled "GNU
Free Documentation License". -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>STABS: Stabs Format</title>

<meta name="description" content="STABS: Stabs Format">
<meta name="keywords" content="STABS: Stabs Format">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Symbol-Types-Index.html#Symbol-Types-Index" rel="index" title="Symbol Types Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Overview.html#Overview" rel="up" title="Overview">
<link href="String-Field.html#String-Field" rel="next" title="String Field">
<link href="Flow.html#Flow" rel="prev" title="Flow">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Stabs-Format"></a>
<div class="header">
<p>
Next: <a href="String-Field.html#String-Field" accesskey="n" rel="next">String Field</a>, Previous: <a href="Flow.html#Flow" accesskey="p" rel="prev">Flow</a>, Up: <a href="Overview.html#Overview" accesskey="u" rel="up">Overview</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Overview-of-Stab-Format"></a>
<h3 class="section">1.2 Overview of Stab Format</h3>

<p>There are three overall formats for stab assembler directives,
differentiated by the first word of the stab.  The name of the directive
describes which combination of four possible data fields follows.  It is
either <code>.stabs</code> (string), <code>.stabn</code> (number), or <code>.stabd</code>
(dot).  IBM&rsquo;s XCOFF assembler uses <code>.stabx</code> (and some other
directives such as <code>.file</code> and <code>.bi</code>) instead of
<code>.stabs</code>, <code>.stabn</code> or <code>.stabd</code>.
</p>
<p>The overall format of each class of stab is:
</p>
<div class="example">
<pre class="example">.stabs &quot;<var>string</var>&quot;,<var>type</var>,<var>other</var>,<var>desc</var>,<var>value</var>
.stabn <var>type</var>,<var>other</var>,<var>desc</var>,<var>value</var>
.stabd <var>type</var>,<var>other</var>,<var>desc</var>
.stabx &quot;<var>string</var>&quot;,<var>value</var>,<var>type</var>,<var>sdb-type</var>
</pre></div>

<p>For <code>.stabn</code> and <code>.stabd</code>, there is no <var>string</var> (the
<code>n_strx</code> field is zero; see <a href="Symbol-Tables.html#Symbol-Tables">Symbol Tables</a>).  For
<code>.stabd</code>, the <var>value</var> field is implicit and has the value of
the current file location.  For <code>.stabx</code>, the <var>sdb-type</var> field
is unused for stabs and can always be set to zero.  The <var>other</var>
field is almost always unused and can be set to zero.
</p>
<p>The number in the <var>type</var> field gives some basic information about
which type of stab this is (or whether it <em>is</em> a stab, as opposed
to an ordinary symbol).  Each valid type number defines a different stab
type; further, the stab type defines the exact interpretation of, and
possible values for, any remaining <var>string</var>, <var>desc</var>, or
<var>value</var> fields present in the stab.  See <a href="Stab-Types.html#Stab-Types">Stab Types</a>, for a list
in numeric order of the valid <var>type</var> field values for stab directives.
</p>



</body>
</html>
